#ifndef NONFINAUT_H_
#define NONFINAUT_H_
#include <iostream>
#include <list>
#include <string>
#include <vector>
#include <sstream>
#include <iterator>
#include "DetFinAut.h"
#include "Transition.h"

using namespace std;

typedef unsigned state;
typedef char input;

enum {EPS = -1, NONE = 0};

template <class Type>
class NonFinAut
{
private:
	list<Type> finishList, startList, stateList;
	list<char> symbolList;
	list<Transition<Type>> transitionList;
public:
	NonFinAut();
	NonFinAut(list<Type> &sList, list<Type> &fList);
	~NonFinAut();
	bool accept(string symbols);
	void addTransition(Type begin, char symbol, Type end);
	list<string> getLanguage(int size);
	void printLanguage(int count);
	void printTransitionRules();
	void rewrite();
	list<string> sort(list<string> &sourceList);
	list<char> getSymbolList();
	list<Type> getStateList();
	list<Type> getStartList();
	list<Type> getFinishList();
	list<Transition<Type> > getTransitionList();
	bool isEndState(const Type &state);
	void makeDrawning(NonFinAut<Type> &obj);
	void addStartState(const Type &str);
	void addFinishState(const Type &str);


	//erbij voor Thompson
	NonFinAut(unsigned size_, state initial_, state final_);
	NonFinAut(const NonFinAut& other);
	NonFinAut<Type>& operator=(const NonFinAut<Type>& other);
	// Voegd transition toe tussen twee states
    void add_trans(state from, state to, input in);
		
	// Fills states 0 up to other.size with other's states
	void fill_states(const NonFinAut& other);
	void shift_states(unsigned shift);
		
	// Appends a new, empty state to the NFA
	//
	void append_empty_state(void);
		
    // Prints out the NFA
    //
    NonFinAut<Type> show(NonFinAut<Type> &nfa);
	string getStateNr(int nr);
    bool is_legal_state(state s);
	state initial;
    state final;
    unsigned size;
    vector<vector<input> > trans_table;
};
#include "NonFinAut.cpp"
#endif

    